#pragma once

#include "base/core/singleton.h"
#include "base/core/object_pool.h"
#include "Common/Timer/TimerAxis.h"
#include "ProtoBuffer/AllProtocol.h"
#include "Common/MessageDispatch/MessageDispatch.h"
#include "Common/Event/Event.h"
#include "Common/EventDefine.h"

//逻辑服事件广播通知管理管理
class LNotifyMgr : public IEventExecuteSink, public ManualSingleton<LNotifyMgr>
{
	friend class ManualSingleton<LNotifyMgr>;
public:
	LNotifyMgr();
	virtual ~LNotifyMgr();
	bool Init();
	void UnInit();
	/////////////////////////////////  IEventExecuteSink  /////////////////////////////////////////
	virtual void OnExecute(uint16_t nEventID, uint64_t nSrcID, uint8_t bySrcType, void *pContext, int32_t nLen);

	//精炼
	void OnEquipRefine(CharIDType cid, EquipRefineEvent &refineEvent);
	//合成材料
	void OnComposeMaterial(CharIDType cid, ComposeEvent &composeEvent);
	//物品改变事件
	void OnItemChange(CharIDType cid, ItemChangeEvent &itemEvent);
};

#define g_MakeLNotifyMgr() (LNotifyMgr::Instance())
#define g_GetLNotifyMgr()  (LNotifyMgr::GetInstance())
#define g_DelLNotifyMgr()  (LNotifyMgr::Destroy())